package com.agent.ai.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@FeignClient(name = "example-service", url = "http://localhost:2020/asp")
public interface AIFeignClient {

    @PostMapping("/ai/flow/nextTasksByNodeId")
    String nextTasksByNodeId(
            @RequestParam(required = false) String nodeId,
            @RequestParam(required = false) String processDefinitionKey
    );

    @RequestMapping(
            value = {"/ai/flow/getFlowUserByNodeId"},
            method = {RequestMethod.GET},
            produces = {"application/json"}
    )
    public String getFlowUserByNodeId(@RequestParam(required = false) String nodeId,
                                      @RequestParam(required = false) String processDefinitionKey,
                                      @RequestParam(required = false) String startUserId,
                                      @RequestParam(required = false) String assigneeId
    );


    @RequestMapping(
            value = {"/ai/flow/startProcessByKeyNew"},
            method = {RequestMethod.POST},
            produces = {"application/json"}
    )
    public Map<String, Object> startProcessByKeyNew(@RequestParam(required = true) String businessKey,
                                                    @RequestParam(required = false) String processDefinitionKey,
                                                    @RequestParam(required = false) String title,
                                                    @RequestParam(required = false) String moduleId,
                                                    @RequestParam(required = false) String firstNode,
                                                    @RequestParam(required = false) String reportStatus,
                                                    @RequestParam(required = false) String mijiid,
                                                    @RequestParam(required = false) String tableName,
                                                    @RequestParam(required = false) String comminfoId,
                                                    @RequestParam(required = false) String formType);

    @PostMapping("/ai/flow/updateReportStatus")
    public Boolean updateReportStatus(@RequestParam(required = true) String taskId,
                                         @RequestParam(required = true) String reportStatus);

    @RequestMapping(
            value = {"/ai/flow/taskCompleteNew"},
            method = {RequestMethod.POST},
            produces = {"application/json"}
    )
    public Map<String, Object> taskCompleteNew(@RequestParam(required = true) String businessKey,
                                               @RequestParam(required = true) String currentTaskId,
                                               @RequestParam(required = true) String nextTaskActivityId,
                                               @RequestParam(required = true) String nextTaskUserIds,
                                               @RequestParam(required = true) String nextTaskUsernames,
                                               @RequestParam(required = false) String assigneeId,
                                               @RequestParam(required = false) String moduleId,
                                               @RequestParam(required = false) String nodeName,
                                               @RequestParam(required = false) String reportStatus,
                                               @RequestParam(required = false) String nodeCode,
                                               @RequestParam(required = false) String rwlxs,
                                               @RequestParam(required = false) String exField5,
                                               @RequestParam(required = false) String processDefinitionId, // 流程监控传入piid
                                               @RequestParam(required = false) String currentNodeId, // 流程监控传入的 nodeid
                                               @RequestParam(required = false) String tjlx,   // 提交类型，判断不为空并且等于 lcjk 说明是流程监控提交的
                                               @RequestParam(required = false) String logtype,//jump流程跳转
                                               @RequestParam(required = false) String tableName,
                                               @RequestParam(required = false) String comminfoId,
                                               @RequestParam(required = false) String processDefinitionKey,
                                               @RequestParam(required = false) String formType
    );

}